package com.dxq.test.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dxq.test.R;
import com.dxq.test.db.Event;

import java.util.List;

/**
 * Author: zsh
 * Date: 2023/11/16
 * Describe: 事件列表adapter
 */
public class EventAdapter extends BaseQuickAdapter<Event, BaseViewHolder> {

    public EventAdapter(int layoutResId) {
        this(layoutResId, null);
    }

    public EventAdapter(int layoutResId, @Nullable List<Event> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, Event item) {
        //holder.setText(R.id.tvSize, String.valueOf(1 + holder.getLayoutPosition()));
        holder.setText(R.id.tvName, item.getName());
        holder.setText(R.id.tvInfo, item.getInfo());
    }

}
